/**
 * 
 */
package instant.openvfs.home;

import x.java.io.File;
import android.graphics.drawable.Drawable;

/**
 * @author qiangli
 * 
 */
public class ResourceInfo {
	public String title; //display name
	public String phonetic;
	public Drawable icon;
	public boolean iconFiltered;
	public File file;
	public boolean selected;
	public int group;
	public boolean top;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((file == null) ? 0 : file.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ResourceInfo other = (ResourceInfo) obj;
		if (file == null) {
			if (other.file != null)
				return false;
		} else if (!file.equals(other.file))
			return false;
		return true;
	}
	
	
	//Intent intent;

//	@Override
//	public boolean equals(Object o) {
//		if (this == o) {
//			return true;
//		}
//		if (!(o instanceof ResourceInfo)) {
//			return false;
//		}
//
//		ResourceInfo that = (ResourceInfo) o;
//		return title.equals(that.title)
//				&& intent.getComponent().getClassName().equals(
//						that.intent.getComponent().getClassName());
//	}
//
//	@Override
//	public int hashCode() {
//		int result;
//		result = (title != null ? title.hashCode() : 0);
//		final String name = intent.getComponent().getClassName();
//		result = 31 * result + (name != null ? name.hashCode() : 0);
//		return result;
//	}
//
//	final void setActivity(ComponentName className, int launchFlags) {
//		intent = new Intent(Intent.ACTION_MAIN);
//		intent.addCategory(Intent.CATEGORY_LAUNCHER);
//		intent.setComponent(className);
//		intent.setFlags(launchFlags);
//	}

}
